# Contributor: Grigory Kirillov <txgk@bk.ru>
# Maintainer:
pkgname=eclib
pkgver=20231212
pkgrel=0
pkgdesc="Tools for creating the elliptic curve databases"
url="https://github.com/JohnCremona/eclib"
# armhf, armv7, x86: blocked by pari
# s390x: blocked by flint
arch="all !armhf !armv7 !s390x !x86"
license="GPL-2.0-or-later"
makedepends="boost-dev flint-dev libntl-dev pari-dev"
source="https://github.com/JohnCremona/eclib/releases/download/v$pkgver/eclib-$pkgver.tar.bz2"
subpackages="$pkgname-static $pkgname-dev $pkgname-libs $pkgname-doc"

build() {
	CXXFLAGS="$CXXFLAGS -O2 -flto=auto" \
	./configure \
		--target="$CTARGET" \
		--build="$CBUILD" \
		--host="$CHOST" \
		--prefix=/usr \
		--with-boost=yes \
		--enable-mpfp
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
692aa6bc2a52cd9496700990172b5a807abbd3f8bf8e931de14c48a401d1d383f95fa5def68bbf9a1aee08dfabac608604c0fd6f8bb49b813e6c6c909a2f27a7  eclib-20231212.tar.bz2
"
